/**
 * created by yangtong on 2025/4/5 22:43:39
 */
const data = [
    //登录
    {
        //访问该路由的路径
        path: '/login',
        //该路由对应组件
        component: () => import('@/layouts/login/index.vue'),
        //路由名称，命名路由
        name: 'login'
    },
    //登录成功后，进入首页的路由
    {
        path: '/',
        component: () => import('@/layouts/home/index.vue'),
        name: 'layout',
        redirect: '/home',
        //子路由，也就是二级路由
        children: [
            {
                path: '/home',
                component: () => import('@/layouts/home/index.vue'),
                name: 'home'
            }
        ]
    },
    //登录成功后，进入首页的路由
    {
        path: '/user',
        component: () => import('@/layouts/index.vue'),
        name: 'user',
        redirect: '/user/add',
        //子路由，也就是二级路由
        children: [
            {
                path: '/user/add',
                component: () => import('@/view/other/index.vue'),
                name: 'addUser'
            }
        ]
    },
    //404路由
    {
        //访问该路由的路径
        path: '/404',
        component: () => import('@/layouts/404/index.vue'),
        name: '404'
    },
    //任意路由，上面都没有匹配上，就进入这个任意路由
    {
        //通配符，表示匹配任意路径，优先级最低
        path: '/:pathMatch(.*)*',
        //重定向，进入这个路由，就会重定向到指定路由
        redirect: '/404',
        name: 'any'
    },
]

export default data